const mysql = require('mysql')
module.exports = {
    config: {
        host: 'localhost',
        port: '3306',
        user: 'root',
        password: 'L1h2m3_123',
        database: 'ysop',
    },

    sqlConnect: function(sql, sqlArr, callBack) {
        var pool = mysql.createPool(this.config)
        pool.getConnection((err, conn) => {
            // console.log('start connect mysql db');
            if (err) {
                console.log('connect to database failed, ErrorInfo: ' + err);
                return;
            }
            conn.query(sql, sqlArr, callBack);
            conn.release();
        })


    },
}